﻿@model List<TrophyListEntry>

@{
    ViewBag.Title = "Pokallisten";
    var actionName = "Trophy";
}

<div class="page-header">
    <h1><span class="glyphicon glyphicon-tower"></span> @ViewBag.Title</h1>
</div>
<ul class="pagination">
    <li>@Html.ActionLink("i dag", actionName, new { date = DateTime.Now.ToString("yyyy-MM-dd") })</li>
    <li>@Html.ActionLink("i går", actionName, new { date = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") })</li>
    <li>@Html.ActionLink("i forgårs", actionName, new { date = DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd") })</li>
    <li>@Html.ActionLink("7 dage siden", actionName, new { date = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd") })</li>
    @foreach (Season s in ViewBag.Seasonlist)
    {
        <li>@Html.ActionLink(s.Name, actionName, new { date = s.EndDate.ToString("yyyy-MM-dd") })</li>
    }
</ul>

<h2>Stilling @ViewBag.SeasonName</h2>
<hr />
<table class="table table-striped">
    <thead>
        <tr>
            <th class="text-center">#</th>
            <th>
                Spiller
            </th>
            <th class="text-right">Point</th>
            <th class="text-right">point ialt</th>
            <th class="text-right">gns. brutto</th>
            <th class="text-right">gns. netto</th>
            <th class="text-right">gns. stbl</th>
            <th class="text-right hidden-xs hidden-sm">runder</th>
            <th class="hidden-xs hidden-sm">seneste runde</th>
        </tr>
    </thead>

    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td class="text-center">
                    @Html.DisplayFor(modelItem => item.TiedPositionIndicator)@Html.DisplayFor(modelItem => item.Position)
                </td>
                <td>
                    <span class="hidden-xs hidden-sm">
                        @Html.DisplayFor(modelItem => item.Player.DisplayName)
                    </span>
                    <span class="hidden-md hidden-lg">
                        @Html.DisplayFor(modelItem => item.Player.Initials)
                    </span>
                </td>
                <td class="text-right">
                    @Html.DisplayFor(modelItem => item.Points)
                </td>
                <td class="text-right">
                    @Html.DisplayFor(modelItem => item.PointsTotal)
                </td>
                <td class="text-right">
                    @Html.DisplayFor(modelItem => item.AverageBruttoscore)
                </td>
                <td class="text-right">
                    @Html.DisplayFor(modelItem => item.AverageNettoscore)
                </td>
                <td class="text-right">
                    @Html.DisplayFor(modelItem => item.AverageStablefordPoints)
                </td>
                <td class="text-right hidden-xs hidden-sm">
                    @Html.DisplayFor(modelItem => item.NumberOfRounds)
                </td>
                <td class="hidden-xs hidden-sm">
                    @item.LatestMatchDate.ToLongDateString()
                </td>
            </tr>
        }
    </tbody>
</table>
